package com.wnxy.sddfp.common.model.dto.user;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * 用户注册DTO
 */
@Data
@ApiModel("用户注册DTO")
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class UserRegistDto {
    // 参数校验注解
    //@NotNull // 不能为NULL，允许是空字符串
    @NotBlank(message = "手机号不能为空")  // 不能为NULL且""
    @Pattern(regexp = "^1[3,4,5,7,8,9]\\d{9}$",message = "手机号码不合法")
    @ApiModelProperty("手机号")
    private String phone;

    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^\\w{6,10}$",message = "密码必须输入6-10位")
    @ApiModelProperty("密码")
    private String pwd;

    @NotBlank(message = "用户名不能为空")
    @ApiModelProperty("用户名")
    private String userName;
}
